home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / lsparsenumber.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  1.1 KB  |  42 lines

  1. <!--- This shows LSParseNumber --->
  2.  
  3. <HTML>
  4.  
  5. <HEAD>
  6. <TITLE>LSParseNumber Example</TITLE>
  7. </HEAD>
  8.  
  9. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  10. <BODY  bgcolor="#FFFFD5">
  11.  
  12. <H3>LSParseNumber Example</H3>
  13.  
  14. <P>LSParseNumber converts a locale-specific string to a
  15. number.  Returns the number matching the value of string.  
  16.  
  17. <!--- loop through a list of possible locales and
  18. show number values  --->
  19. <CFLOOP LIST="#Server.Coldfusion.SupportedLocales#"
  20. INDEX="locale" DELIMITERS=",">
  21.     <CFSET oldlocale = SetLocale(locale)>
  22.  
  23.     <CFOUTPUT><P><B><I>#locale#</I></B><BR>
  24.         #LSNumberFormat(-1234.5678, "_________")#<BR>
  25.         #LSNumberFormat(-1234.5678, "_________.___")#<BR>
  26.         #LSNumberFormat(1234.5678, "_________")#<BR>
  27.         #LSNumberFormat(1234.5678, "_________.___")#<BR>        
  28.         #LSNumberFormat(1234.5678, "$_(_________.___)")#<BR>        
  29.         #LSNumberFormat(-1234.5678, "$_(_________.___)")#<BR>        
  30.         #LSNumberFormat(1234.5678, "+_________.___")#<BR>        
  31.         #LSNumberFormat(1234.5678, "-_________.___")#<BR>        
  32.         The actual number: #LSParseNumber(LSNumberFormat(1234.5678, "_________"))#<BR>
  33.         <hr noshade>
  34.     </CFOUTPUT>
  35.  
  36. </CFLOOP>
  37.  
  38.  
  39.  
  40. </BODY>
  41. </HTML>       
  42.